package com.itheima.MOop;

public class Student {
  private   String name;
   private int age;

    public  void setAge(int age) {
        if(age >=0 && age<=120){
            this.age = age;
        }else{
            System.out.println("您的年龄不合理");
        }
    }
    public  void setname(String name) {
            this.name=name;
    }
    public int getage(){return age;}//等价于:return this.age
    public String getname(){return name;}//等价于:return this.name

    public void show(){
        System.out.println(this.age + "..."+ this.name);
    }

}
